Skip to content

Modified QcAllocator to store File Descriptor #3966

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

quic-apreetam
Copy link
Contributor

@quic-apreetam quic-apreetam commented Jul 9, 2025

Add support to store the file descriptor (fd) of the allocated memory in the userdata field of cv::UMatData
fcvHwMemAlloc API has been updated to support fd.

Updated libs PR: opencv/opencv_3rdparty#100

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@quic-apreetam
Copy link
Contributor Author

@gursimarsingh @asmorkalov

@asmorkalov
Copy link
Contributor

[2288/3365] Building CXX object modules/fastcv/CMakeFiles/opencv_fastcv.dir/src/allocator.cpp.o
FAILED: modules/fastcv/CMakeFiles/opencv_fastcv.dir/src/allocator.cpp.o 
/usr/bin/ccache /usr/bin/c++  -DCVAPI_EXPORTS -DHAVE_FASTCV=1 -D_USE_MATH_DEFINES -D__OPENCV_BUILD=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/ci/opencv/hal/fastcv/include -I/home/ci/opencv_contrib/modules/fastcv/include -Imodules/fastcv -I/home/ci/opencv/modules/core/include -I/home/ci/opencv/modules/flann/include -I/home/ci/opencv/modules/imgproc/include -I/home/ci/opencv/modules/dnn/include -I/home/ci/opencv/modules/features2d/include -I/home/ci/opencv/modules/calib3d/include -I/home/ci/opencv/modules/video/include -I3rdparty/fastcv/inc -isystem . -isystem /usr/include/eigen3 -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG -fPIC   -std=c++11 -MD -MT modules/fastcv/CMakeFiles/opencv_fastcv.dir/src/allocator.cpp.o -MF modules/fastcv/CMakeFiles/opencv_fastcv.dir/src/allocator.cpp.o.d -o modules/fastcv/CMakeFiles/opencv_fastcv.dir/src/allocator.cpp.o -c /home/ci/opencv_contrib/modules/fastcv/src/allocator.cpp
/home/ci/opencv_contrib/modules/fastcv/src/allocator.cpp: In member function 'virtual cv::UMatData* cv::fastcv::QcAllocator::allocate(int, const int*, int, void*, size_t*, cv::AccessFlag, cv::UMatUsageFlags) const':
/home/ci/opencv_contrib/modules/fastcv/src/allocator.cpp:60:79: error: too many arguments to function 'void* fcvHwMemAlloc(uint32_t, uint32_t)'
   60 |     uchar* data = data0 ? (uchar*)data0 : (uchar*)fcvHwMemAlloc(total, 16, &fd);

@asmorkalov
Copy link
Contributor

Looks like the patch requires opencv/opencv#27525. Please re-create one of the PRs with the same branch name and author (github org name) to check them together.

Also I propose to introduce some versioning (macro) and checks in code/cmake to control compatibility.

@quic-apreetam
Copy link
Contributor Author

Looks like the patch requires opencv/opencv#27525. Please re-create one of the PRs with the same branch name and author (github org name) to check them together.

Also I propose to introduce some versioning (macro) and checks in code/cmake to control compatibility.

hi @asmorkalov

Created a PR with same branch name: #3969

@quic-apreetam
Copy link
Contributor Author

Closing this one as we have another one opencv/opencv_contrib/#3969

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants